def isLeapYear(year):
    return (year%4==0 and year %100!=0) or (year%400==0)

y=int(input())
m=int(input())
d=int(input())

month=[0,31,28,31,30,31,30,31,31,30,31,30,31]
if isLeapYear(y):
    month[2]=29

if 1<=m<=12 and 1<=d<=month[m]:
    print('y')
else:
    print('n')